@import './variables.scss';
@import './mixin.scss';
@import './transition.scss';
@import './element-ui.scss';
@import './sidebar.scss';
@import './tech-theme.scss';

// Import Google Fonts - adding Nunito for headings
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&family=Nunito:wght@400;600;700&display=swap');

body {
  height: 100%;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  font-size: 14px;
  color: $textBody;
  background-color: $backgroundLight;
}

// Typography size adjustments for a more modern look
h1, h2, h3, h4, h5, h6 {
  font-family: 'Nunito', 'Open Sans', sans-serif;
  margin-top: 0;
  color: #303133;
}

h1 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
}

h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
}

h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

h5, h6 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}

p {
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 12px;
  color: #606266;
}

.secondary-text {
  font-size: 13px;
  color: #909399;
}

label {
  font-weight: 500;
  font-size: 13px;
}

html {
  height: 100%;
  box-sizing: border-box;
}

#app {
  height: 100%;
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

a:focus,
a:active {
  outline: none;
}

a,
a:focus,
a:hover {
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}

div:focus {
  outline: none;
}

.clearfix {
  &:after {
    visibility: hidden;
    display: block;
    font-size: 0;
    content: " ";
    clear: both;
    height: 0;
  }
}

// Main content layout
.app-container {
  padding: 20px;
}

// Page heading
.page-heading {
  margin-bottom: 24px;
  
  h1 {
    font-size: 24px;
    font-weight: 600;
    color: $textTitle;
    margin: 0 0 8px 0;
  }
  
  .description {
    color: $textLight;
    font-size: 14px;
  }
}

// Button group spacing
.button-group {
  display: flex;
  gap: 8px;
  
  @media screen and (max-width: 576px) {
    flex-direction: column;
  }
}

// Card styles enhancement
.el-card {
  margin-bottom: 16px;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}

// Table filter form standard layout
.filter-container {
  margin-bottom: 16px;
  padding: 16px 20px;
  background-color: #FFFFFF;
  border-radius: $radiusMedium;
  box-shadow: $shadowCard;
}

// Status tag colors for common statuses
.status-normal { background-color: rgba($success, 0.1); color: $success; }
.status-warning { background-color: rgba($warning, 0.1); color: $warning; }
.status-danger { background-color: rgba($danger, 0.1); color: $danger; }
.status-info { background-color: rgba($primaryBlue, 0.1); color: $primaryBlue; }

// Form layouts
.form-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
  background-color: #FFFFFF;
  border-radius: $radiusMedium;
  box-shadow: $shadowCard;
  
  .form-title {
    font-size: 18px;
    font-weight: 600;
    color: $textTitle;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid $borderLight;
  }
  
  .form-footer {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid $borderLight;
    display: flex;
    justify-content: flex-end;
  }
}

// Transitions
.fade-transform-enter-active, .fade-transform-leave-active {
  transition: all 0.3s;
}

.fade-transform-enter-from {
  opacity: 0;
  transform: translateX(-20px);
}

.fade-transform-leave-to {
  opacity: 0;
  transform: translateX(20px);
}

// Micro-animations for interactive elements
.hover-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  
  &:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }
}

// Loading state
.is-loading {
  position: relative;
  pointer-events: none;
  
  &:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 999;
  }
}

// Card styles - refined shadow and border radius
.el-card {
  border-radius: 6px;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);
  border: none;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  background-color: #ffffff;
  
  &:hover {
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
  }

  .el-card__header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background-color: #ffffff;
  }
  
  .el-card__body {
    padding: 16px;
    background-color: #ffffff;
  }
}

// Divider styles
.divider {
  height: 1px;
  background-color: $lightDivider;
  margin: 12px 0;
  opacity: 0.7;
}

// Button ripple effect - more subtle
.el-button {
  position: relative;
  overflow: hidden;
  font-weight: 500;
  padding: 6px 12px;  // Default to small size
  font-size: 12px !important;    // Default to small size with !important to override inline styles
  border-radius: 4px;
  transition: all 0.2s ease;
  letter-spacing: 0.3px;
  
  i {
    font-size: 14px !important; // Force icons to be smaller
  }
  
  &::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
    pointer-events: none;
  }
  
  &:active::after {
    width: 200px;
    height: 200px;
    opacity: 0;
    transition: 0s;
  }
  
  &:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  }
  
  // Size variants - keeping these for when explicit sizing is needed
  &.el-button--mini {
    padding: 4px 9px;
    font-size: 11px !important;
    
    i {
      font-size: 12px !important;
    }
  }
  
  &.el-button--small {
    padding: 6px 12px;
    font-size: 12px !important;
    
    i {
      font-size: 14px !important;
    }
  }
  
  &.el-button--medium {
    padding: 8px 15px;
    font-size: 13px !important;
    
    i {
      font-size: 15px !important;
    }
  }
}

// Table buttons - make them more compact
.el-table {
  .el-button {
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1;
    margin: 2px;
    box-shadow: none;
    
    &:hover {
      transform: translateY(0);
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
  }
}

// Dialog footer buttons
.el-dialog__footer {
  .el-button {
    padding: 6px 12px;
    font-size: 12px;
  }
}

// Input elements standard styling
.el-input__inner {
  height: 32px;
  line-height: 32px;
  font-size: 13px;
  border-radius: 4px;
  transition: all 0.2s ease;
  
  &:focus {
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
  }
}

.el-input__icon {
  line-height: 32px;
}

.el-select, .el-date-editor {
  width: 100%;
}

// Tags should be compact
.el-tag {
  height: 22px;
  line-height: 20px;
  font-size: 12px;
  padding: 0 7px;
  border-radius: 3px;
}

// View containers styling
.el-main {
  padding: 16px;
  background-color: #f0f2f5;
}

// Main content elements
.el-form {
  margin-bottom: 16px;
}

.el-table {
  margin: 8px 0 16px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);
  
  th.el-table__cell {
    background-color: #F2F6FC;
    font-size: 13px;
    padding: 8px 0;
  }
  
  td.el-table__cell {
    padding: 8px 0;
    font-size: 13px;
  }
}

.el-pagination {
  margin-top: 16px;
  padding: 0;
  text-align: right;
}

// Icons size standardization
.el-icon-s-grid, 
.el-icon-menu, 
.el-icon-search, 
.el-icon-date, 
.el-icon-document,
.el-icon-star-off,
.el-icon-view {
  font-size: 14px;
}

// Force any iconfont class to be a reasonable size
[class^="iconfont"],
[class*=" iconfont"] {
  font-size: 14px !important;
}

// Specific selector to override inline styles on icon fonts in buttons
.el-button [class^="iconfont"],
.el-button [class*=" iconfont"],
.el-button i {
  font-size: 14px !important;
}

// Responsive breakpoints
@media screen and (max-width: 1200px) {
  // lg breakpoint
  .app-container, .el-main {
    padding: 14px;
  }
}

@media screen and (max-width: 768px) {
  // md breakpoint
  .app-container, .el-main {
    padding: 12px;
  }
}

@media screen and (max-width: 576px) {
  // sm breakpoint
  .app-container, .el-main {
    padding: 10px;
  }
}

@media screen and (max-width: 360px) {
  // xs breakpoint
  .app-container, .el-main {
    padding: 8px;
  }
}
